import java.util.*;

public class Female extends Person {
	private int numberOfPregnancies;

	public Female(String name, String surname, int age, String phone,
			int numberOfPregnancies) {
		super(name, surname, age, phone);
		this.numberOfPregnancies = numberOfPregnancies;
	}

	public void setNumberOfPregnancies() {
		Scanner sc = new Scanner(System.in);
		numberOfPregnancies = sc.nextInt();
		sc.close();
	}

	public int getNumberOfPregnancies() {
		return numberOfPregnancies;
	};

	@Override
	public String toString() {
		super.toString();
		String s = "";
		s += numberOfPregnancies;
		return s;
	}

	@Override
	public boolean equals(Object obj) {
		super.equals(obj);
		Female female = (Female) obj;
		if (female.numberOfPregnancies == numberOfPregnancies) {
			return true;
		}
		return false;
	}

	@Override
	public int hashCode() {
		int hash = 1;
		hash = hash * 17 + numberOfPregnancies;
		hash = 17 * hash + name.hashCode();
		hash = 17 * hash + surname.hashCode();
		hash = 17 * hash + phone.hashCode();
		return hash;
	}

	public boolean matchByPregnancies(int numberOfPregnancies) {
		return this.numberOfPregnancies == numberOfPregnancies;
	}
}
